#!/usr/bin/env python
dailyData = {
'Jelly' : {'url' : 'http://www.neopets.com/jelly/jelly.phtml',
           'phraseInForm' : 'Grab some Jelly',
           'fileToWrite' : 'logs/jelly.html',
           'freq': 'daily',
           'reg' : [('win',"""You take some <b>(.+)</b>"""),
                    ('notyet',"""The Jelly has been eaten""")] },


'Omelette' : {'url' : 'http://www.neopets.com/prehistoric/omelette.phtml',
           'phraseInForm' : 'Grab some Omelette',
           'fileToWrite' : 'logs/omelette.html',
           'freq': 'daily',
           'reg' : [('win',"""http://images\.neopets\.com/items/(.+\.gif)"""),
                    ('notyet',"""The Omelette has Gone!!!"""),
                    ('notyet',"""'NO!  You cannot take more than one slice per day!""")] },


'Anchor' : {'url' : 'http://www.neopets.com/pirates/anchormanagement.phtml',
           'phraseInForm' : 'HiddenControl(action=',
           'fileToWrite' : 'logs/anchor.html',
           'freq': 'daily',
           'reg' : [('win',"""prize-item-name">(.+)<"""),
                    ('notyet',"""you've already done your share to keep Krawk Island safe from sea monsters for one day""")] },


'Shrine' : {'url' : 'http://www.neopets.com/desert/shrine.phtml',
           'phraseInForm' : 'Approach the Shrine',
           'fileToWrite' : 'logs/shrine.html',
           'freq': '720',
           'reg' : [('win',"""walks slowly up to the strange shrine\.\.\..+\<p\>\<b\>(.+)\<\/b\>\<p\>\<IMG"""),
                    ('win',"""Some food from the Lost Desert appears in front of you"""),
                    ('win',"""You find a .+ lying in the sand."""),
                    ('win',"""Coltzan has granted you a magical lens."""),
                    ('win',"""I will do what I can to help you</b><p><b>(.+)!</b><p><IMG""")] },


'Bank Deposit' : {'url' : 'http://www.neopets.com/bank.phtml',
           'phraseInForm' : 'deposit',
           'fileToWrite' : 'logs/bankDeposit.html',
           'postData' : {},
           'freq': 'daily',
           'reg' : [('win',"""Your current balance and interest rate allow you to gain <b>(.+)</b> per day"""),
                    ('money',"""In order to earn some interest, you might want to deposit a few more Neopoints into your account.""")] },


'Bank Interest' : {'url' : 'http://www.neopets.com/bank.phtml',
           'phraseInForm' : 'Collect Interest',
           'fileToWrite' : 'logs/bankInterest.html',
           'freq': 'daily',
           'reg' : [('win',"""Your current balance and interest rate allow you to gain <b>(.+)</b> per day"""),
                    ('money',"""In order to earn some interest, you might want to deposit a few more Neopoints into your account.""")] },


'Ice Scratch Card' : {'url' : 'http://www.neopets.com/winter/kiosk.phtml',
           'phraseInForm' : 'Yes, I will have one please',
           'fileToWrite' : 'logs/iceScratchard.html',
           'freq': '360',
           'reg' : [('win',"""You now have a <b>(.+)</b> -"""),
                    ('money',"""You do not have enough Neopoints to buy a scratchcard!"""),
                    ('notyet',"""<p><b>Hey, give everybody else a chance to buy a scratchcard!!  (.+)!</b><p>""")] },


'Desert Scratch Card' : {'url' : 'http://www.neopets.com/desert/sc/kiosk.phtml',
           'phraseInForm' : 'yes, i will have one please',
           'fileToWrite' : 'logs/desertscratchard.html',
           'freq': '120',
           'reg' : [('win',"""you now have a <b>(.+)</b> -""")] },


'Halloween Scratch Card' : {'url' : 'http://www.neopets.com/halloween/scratch.phtml',
           'phraseInForm' : """OK I'll take one""",
           'fileToWrite' : 'logs/halloweenScratchard.html',
           'freq': '240',
           'reg' : [('win',"""You now have a <b>(.+)</b> -""")] },


'Fruit Machine' : {'url' : 'http://www.neopets.com/desert/fruitmachine.phtml',
           'phraseInForm' : """Spin, spin, spin""",
           'fileToWrite' : 'logs/fruitMachine.html',
           'freq': 'daily',
           'reg' : [('loss',"""Sorry! This is not a winning spin.<br>I hope you have better luck tomorrow!"""),
                    ('win',"""You have won <b>400</b> Neopoints!"""),
                    ('money',"""You don't have enough Neopoints to spin this Wheel!"""),
                    ('win',"""You have won <b>.+ NP</b>!"""),
                    ('notyet',"""You have already played today.""")
                    ] },


'Plushie Of Prosperity' : {'url' : 'http://www.neopets.com/faerieland/tdmbgpop.phtml',
           'phraseInForm' : """Talk to the Plushie""",
           'fileToWrite' : 'logs/plushieOfProsperity.html',
           'freq': 'daily',
           'reg' : [('win',"""You're sure you can give the <b>(.+)</b> a new home!"""),
                    ('notyet',"""You have already visited the plushie today, and he appreciates your attention, but he needs to sleep now."""),
                    ('win',"""Oh, it's a <b>.+</b>!"""),
                    ('win',"""<div align='center'>(.+)</div><br><center><form"""),
                    ('win',"""The plushie remains ever silent, but as you leave you notice (.+) Neopoints on the ground. Perhaps it was good luck or..."""),
                    ('loss',"""You wait around for a bit, but nothing seems to happen. Best be on your way."""),
                    ('win',""">While staring at the discarded plushie, (.+)</div>""")] },


'Fishing' : {'url' : 'http://www.neopets.com/water/fishing.phtml',
           'phraseInForm' : """Reel In Your Line""",
           'fileToWrite' : 'logs/fishing.html',
           'freq': '720',
           'reg' : [('win',"""<BR><B>(.+)</B>!<P></CENTER><center>"""),
                    ('loss',"""You reel in your line and get...<P><CENTER><B>Nothing!""")] },



'Tombola' : {'url' : 'http://www.neopets.com/island/tombola.phtml',
           'phraseInForm' : 'Play Tombola',
           'fileToWrite' : 'logs/tombola.html',
           'freq': 'daily',
           'reg' : [('win',"""Your Prize - (.+)<\/b\>"""),
                    ('win',"""You Win.+"""),
                    ('win',"""http://images.neopets.com/items/(.+).gif"""),
                    ('notyet',"""Closed.  Back in an hour or so"""),
                    ('notyet',"""Wouldn't you know it, I just gave my last Neopoints away to somebody, so I have none left to buy prizes with"""),
                    ('notyet',"""Sorry, you are only allowed one Tombola free spin every day"""),
                    ('loss',"""Oh dear, that's not a winning ticket .+<center>""")] },



'Healing Springs' : {'url' : 'http://www.neopets.com/faerieland/springs.phtml',
           'phraseInForm' : 'Heal my Pets',
           'fileToWrite' : 'logs/healingSprings.html',
           'freq': '30',
           'reg' : [('win',"""All of your Neopets gain <font color=green><b>.+</b></font> hit points"""),
                    ('win',"""All of your Neopets gain .+ hit points."""),
                    ('win',"""All your Neopets have their health completely restored"""),
                    ('notavailable',"""Sorry!</b> - My magic is not fully restored yet.  Please try back later."""),
                    ('win',"""><p><b>The Water Faerie says a few magical words and...</b><p><p><b>(.+)<p>""")] },

'Bob4Apples' : {
           'url' : 'http://www.neopets.com/halloween/applebobbing.phtml',
           'url2' : 'http://www.neopets.com/halloween/applebobbing.phtml?bobbing=1',
           'fileToWrite' : 'logs/apples.html',
           'reg' : [('win',"""Your Prize - (.+)<\/b\>"""),
                    ('loss', """While .+</div>"""),
                    ('loss', """You finally decide.+</div>"""),
                    ('loss',"""You flail around in disgusted horror until you hit the fence and tumble headfirst over it."""),
                    ('loss',"""As you gaze into the water, about to bob your head in for a chance at appley-goodness, you notice a reflection in the water. It's Bart's hat. You're suddenly struck by a strange, uncomfortable feeling. Feeling ill at ease, you decide to skip bobbing for apples and head straight home. You don't sleep well."""),
                    ('loss',"""You lean too far forward and fall head-first into the barrel! Bart grabs you by the collar and drags you out but now you are too drenched to continue on your search for the perfect prize"""),
                    ('loss',"""Suddenly, someone bumps into you from behind, causing you to lose your concentration and sight of your prize. Drat!!"""),
                    ('loss',"""You eagerly swish your head around in the water, and finally catch something in your teeth and bring it up. ARGH, you got a mouthful of Spyders! You spit them out in surprise, ending up with no prize at all."""),
                    ('loss',"""As you finally pull out an item you had your eye on, a passing Batterfly flies around your head, causing you to flail and drop the prize back into the barrel."""),
                    ('loss',"""You get very greedy and try to wrestle with several items at once. You lose your grip on all of them and end up with nothing at all. Pity!"""),
                    ('loss',"""Oh no! It seems you've had a spot of bad luck, my friend. I guess that's how it goes in life - sometimes you get the apple, and then other times the apple gets you. Don't be discouraged, though... after all, you never know: your next bob could be your best bob! Visit your <a href='/objects.phtml?type=inventory'><b>inventory</i></a> to see what you got.	</div>"""),
                    ('notyet',"""I'm afraid you'll just have to wait until tomorrow to try your luck again."""),
                    ('win',"""<br><b>(.+)</b><br><br>It can be found in your <""")],
           'freq' : 'daily'},

'20x Bagatelle' : {
           'url' : 'http://www.neopets.com/halloween/bagatelle.phtml',
           'reg' : [('win',"""points=(\d+)""")],
           'requestToSend' : ("http://www.neopets.com/halloween/process_bagatelle.phtml?r=%s", "onData=%5Btype%20Function%5D"),
           'referer' : "http://swf.neopets.com/halloween/bagatelle_v5.swf?lang=en&baseurl=www.neopets.com",
           'fileToWrite' : 'logs/bagaRESP%s.html',
           'freq' : 'daily'},

'Slug' : { 'url' : 'http://www.neopets.com/shop_of_offers.phtml',
           'phraseInForm' : 'shop_of_offers.phtml?slorg_payout=yes',
           'url2' : 'http://www.neopets.com/shop_of_offers.phtml?slorg_payout=yes',
           'fileToWrite' : 'logs/slorgPayout.html',
           'reg' : [('win',"""\d+ Neopoints""")],
           'freq' : 'daily'},

'Wheel of Excitement' : {'url' : 'http://www.neopets.com/faerieland/wheel.phtml',
           'referer' : """http://images.neopets.com/wheels/wheel_of_excitement_v3_831fbec8f8.swf\?r=\d+""",
           'fileToWrite' : 'logs/wheel.html',
           'requestToSend' : ("http://www.neopets.com/amfphp/gateway.php", "\x00\x03\x00\x00\x00\x01\x00\x16WheelService.spinWheel\x00\x02/1\x00\x00\x00\x09\x0a\x00\x00\x00\x01\x02\x00\x012"),
           'reg' : [('notyet',"""Alas, you've already spun this wheel in the last two hours. You can return again later for another go!"""),
                    ('loss',"""Something mysterious happens to you and your pets... you are not sure what it is, however..."""),
                    ("loss","""Something mysterious happens to you and your pets... you are not sure what it is, however.."""),
                    ('loss',"""Golden Light.+ completely healed!"""),
                    ("win","""\d+NP"""),
                    ("win","""\d+ NP"""),
                    ("win","""\d+,\d+NP"""),
                    ("win","""\d+, \d+NP"""),
                    ("loss","""A lightning bolt shoots out of a cloud and ZAPS your Neopets"""),
                    ("loss","""THE SKULL!!!.+starts to feel slightly feverish... maybe they have come down with a disease?"""),
                    ('loss',"""Pant Devil</b> appears and steals your <b>.+</b>!"""),
                    ('loss',"""The <b>Pant Devil</b> appears and steals your <b>.+</b>!</font>"""),
                    ('loss',"""The <font color='purple'>Dark Faerie'</font> cackles and waves her hands, but nothing happens.</font></center>"""),
                    ('loss',"""The <font color='purple'>Dark Faerie'</font> cackles and waves her hands, but nothing happens."""),
                    ('win', """<b>.+ NP<br/>"""),
                    ('loss',"""nothing happens"""),
                    ('loss',"""Something mysterious happens to you and your pets"""),
                    ('loss',"""THE SKULL!!!.+</font>"""),
                    ('win',"""<br/><br/><b>(.+NP)<br/>"""),
                    ('loss',"""You've already told me a joke today!"""),
                    ("loss","""Lava Ghoul"""),
                    ("loss","""LavaGhoul"""),
                    ("loss","""Lava Ghoul</b></font> flies down from a nearby cloud and breathes <font color='red'>FIRE</font> over your pets!""")],
           'freq' : '120'},

'Potato Counter' : {
           'url' : 'http://www.neopets.com/medieval/potatocounter.phtml',
           'phraseInForm' : 'guess',
           'fileToWrite' : 'logs/potatoe.html',
           'reg' : [('win', "You got it right in <b>\d+</b> seconds, which means you win <b>\d+</b> Neopoints!")],

           'freq' : 'daily'},

'Grumpy King' : {
           'url' : 'http://www.neopets.com/medieval/grumpyking.phtml',
           'phraseInForm' : 'Tell the King your joke',
           'fileToWrite' : 'logs/grumpyKing.html',
           'reg' : [('loss', """Drat!  It looks like your joke had no effect on the Grumpy Old King."""),
                    ('notyet',"""You've already told me a joke today!"""),
                    ('loss',"""King Skarl Says:.+That was the worst joke ever!  I only give it .+ out of .+!"""),
                    ('win',"""Here, have a little something from my kitchen.  I hope you like it.+"""),
                    ('win', """You've done it!.+""")],
           'freq' : 'daily'
},

'Wise King' : {
           'url': 'http://www.neopets.com/medieval/wiseking.phtml',
           'phraseInForm': "Impress King Hagan with your wisdom!",
           'fileToWrite' : 'logs/wiseKing.html',
           'reg' : [('win',"""Here is something to help you study.<br><br><strong>(.+)"""),
                    ('loss',"""Perhaps a bit of studying will help you before you return tomorrow."""),
                    ('loss',"""That didn't make any sense at all.  Preposterous!"""),
                    ('notyet',"""Ahh. It seems you have already regaled me with your wisdom today.""")],
           'freq' : 'daily'},

'Toy Chest' : {
           'url' : 'http://www.neopets.com/petpetpark/daily.phtml',
           'fileToWrite' : 'logs/toyChest.html',
           'postData' : 'go=1',
           'reg' : [('win',"""You've received the following prize!(.+)"""),
                    ('notyet',"""You've already collected your prize today.  Come back again tomorrow, dearie!""")],
           'freq' : 'daily'},

'Trivia Question' : {
           'url' : 'http://www.neopets.com/community/index.phtml',
           'externalurl' : 'http://www.thedailyneopets.com/dailies/',
           'phraseInForm' : 'trivia_response',
           'fileToWrite' : 'logs/triviaQuestion.html',
           'reg' : [('win',"You have been awarded <b>\d+ NP</b>"),
                    ('win',"""You win <b>.+</b> NP and <b>.+</b>.  Way to go!""")],
           'freq' : 'daily'},

'Buy 1000x Stocks' : {
           'url' : 'http://www.neopets.com/stockmarket.phtml?type=list&full=true',
           'fileToWrite' : 'logs/stocksBought.html',
           'phraseInForm' : 'amount_shares',
           'postData' : {'amount_shares': '1000'},
           'reg' : [('needmoney',"""You cannot afford that!"""),
                    ('notyet',"""Sorry, that would take you over the daily purchase limit""")],
           'freq' : 'daily'},

'Sell Stocks' : {
           'url' : 'http://www.neopets.com/stockmarket.phtml?type=portfolio',
           'firstFileToWrite' : 'logs/stocksPortfolio.html',
           'fileToWrite' : 'logs/stocksSold.html',
           'phraseInForm' : 'sell',
           'reg' : [('win',"""Summary(.+)"""),
                    ('win',"""\d+ shares of .+NP.""")],
           'freq' : 'daily'},


'Snowager' : {
           'url' : 'http://www.neopets.com/winter/snowager.phtml',
           'url2' : 'http://www.neopets.com/winter/snowager2.phtml',
           'fileToWrite' : 'logs/snowager.html',
           'reg' : [('loss',"""The snowager rears up and fires an icy blast.+<p>"""),
                    ('win',"""You carefully walk in and pick up a .+</b></center>"""),
                    ('win',"""<p><table width=300 border=1 cellpadding=6 cellspacing=0 align=center><tr><td width=300 align=center><img src='http://images.neopets.com/battledome/opponent_pics/snowager.gif' width=100 height=100 border=1><p><b>NEW BATTLEDOME CHALLENGER!!!</b><p><b>The Snowager</b> will be waiting for you in the <a href='/battledome/battledome.phtml?type=oneplayer&subtype=info'><b>BATTLEDOME</b></a>!!!"""),
                    ('win',"""<p><b>ROOOOAARRR!!!</b> - The snowager rears up and fires a MASSIVE icy blast at you and your Neopets!!!  Oh no!!!"""),
                    ('win',"""<p>You carefully walk in and pick up a .+ from the pile of treasure, and then run for your life!!!!!<p>.+<b>.+</b></center>""")],

           'freq' : 'daily'},

'Lunar Temple' : {
           'url' : 'http://www.neopets.com/shenkuu/lunar/',
           'url2': 'http://www.neopets.com/shenkuu/lunar/?show=puzzle',
           'fileToWrite' : 'logs/lunarTemple.html',
           'phraseInForm' : 'phase_choice',
           'reg' : [('win',"""<a href='/objects.phtml?type=inventory'><img src='http://images.neopets.com/items/(.+).gif' border='0' width='80' height='80'></a><br><br>"""),
                    ('win',"""<a href='/objects.phtml?type=inventory'><img src='http://images.neopets.com/items/(.+).gif' border='0' width='80' height='80'></a><br><br>"""),
                    ('win',"""http://images.neopets.com/items/(.+).gif""")],
           'freq' : 'daily'},


'Meteor' : {
           'url' : 'http://www.neopets.com/moon/meteor.phtml',
           'phraseInForm' : 'Take a chance',
           'phraseInForm2' : 'meteorselect',
           'postData' : {'pickstep': '1'},
           'fileToWrite' : 'logs/meteor.html',
           'reg' : [('loss','You stare at the now empty space and wonder what happened.'),
                    ('loss',"Meteors are funny like that. They just don't feel like company sometimes."),
                    ('loss',"Maybe it was all a dream."),
                    ('win',"""The meteor has cracked open and a small object falls out.<p><div align='center'><img src='.+'><br>(.+)</div><p><div align='center'>"""),
                    ('loss','This must not be your lucky day. The meteor just disappeared.')],
           'freq' : 'daily'},

'Altador' : {
           'url' : 'http://www.neopets.com/altador/council.phtml',
           'fileToWrite' : 'logs/altador1.html',
           'fileToWrite2' : 'logs/altador2.html',
           'fileToWrite3' : 'logs/altador3.html',
           'phraseInForm' : 'prhv',
           'phraseInForm2' : 'collect',
           'regForURL' : """<AREA shape="poly" coords="[\d+|\,]+" href="(\S+)">""",
           'reg' : [('win',"""King Altador hands you your gift...+</DIV>""")],
           'freq' : 'daily'},

'Forgotten Shore' : {
           'url' : 'http://www.neopets.com/pirates/forgottenshore.phtml',
           'url2' : 'http://www.neopets.com/pirates/forgottenshore.phtml?confirm=1&_ref_ck=%s',
           'fileToWrite' : 'logs/forgotten1.html',
           'fileToWrite2' : 'logs/forgotten2.html',
           'reg' : [('win', """You have received .+""")],
           'ref_ck' : """confirm=1&_ref_ck=(.+)'><div id=""",
           'freq' : 'daily'},

'Food club' : {
           'url' : 'http://www.neopets.com/pirates/foodclub.phtml?type=bet',
           'fileToWrite' : 'logs/foodclubb4.html',
           'fileToWrite2' : 'logs/foodclubafter.html',
           'phraseInForm' : 'process_foodclub',
           'reg' : [('maybewin',"""Total Possible Winnings.+<b>(\d+) NP""")],
           'freq' : 'daily'},

'Wishing Well' : {
           'url' : 'http://www.neopets.com/wishing.phtml',
           'fileToWrite' : 'logs/wishingWell.html',
           'filesToWrite' : 'logs/wishingWell%s.html',
           'phraseInForm' : 'process_wishing',
           'reg' : [],
           'freq' : '720'},

'Auction From Shop' : {
           'url' : 'http://www.neopets.com/market.phtml?order_by=price&type=your&lim=30',
           'invurl' : 'http://www.neopets.com/objects.phtml?type=inventory',
           'shopFileToWrite' : 'logs/shopB4Auction.html',
           'invFileToWrite' : 'logs/invB4Auction.html',
           'invFileToWrite2' : 'logs/invDuringAuction.html',
           'fileToWrite' : 'logs/afterRemoveItemsFromShopForAuction.html',
           'phraseInForm' : 'process_market',
           'freq' : '180'},

'Check mail' : {
           'url' : 'http://www.neopets.com/neomessages.phtml?folder=Inbox',
           'fileToWrite' : 'logs/generalMail.html',
           'filesToWrite' : 'logs/individualMail%s.html',
           'phraseInForm' : 'modify_neomessages',
           'freq' : 'daily'},


'Merry Go Round' : {
           'url' : 'http://www.neopets.com/worlds/roo/merrygoround.phtml',
           'fileToWrite' : 'logs/merryGoRound1_ride_%s.html',
           'fileToWrite2' : 'logs/merryGoRound2_ride_%s.html',
           'phraseInForm' : 'merrygoround2',
           'reg' : [('win', """I hope you enjoyed your ride, come again soon""")],
           'freq' : 'daily'},


}
